<template>
  <div class="newSynchronouspew">
    <div v-if="datas.synCommodityType">
      <!-- 无背景 -->
      <div class="newSynchronouspewicon defaultcommodityList0" v-show="datas.synCommodityType === 0">
        <img src="../../../assets/img/icon10-1.png" alt="" />
      </div>
      <!-- 有背景 -->
      <div class="newSynchronouspewicon" v-show="datas.synCommodityType === 1">
        <img v-if="!datas.topImage" style="width: 373px; display:block" src="../../../assets/images/tbpytop.png" alt="">
        <img v-else style="width: 373px; display:block" :src="datas.topImage" alt="">
        <div class="defaultcommodityList1" :style="{ background: datas.bgcolors }">
          <!-- 无内容 -->
          <div class="synchcontent"  v-show="!datas.imageList || !datas.imageList[0]">
            <img class="zhanwei" src="../../../assets/img/icon10-1.png" alt="" />
            <img class="fengexian" v-show="datas.appListType === 0" src="../../../assets/images/fengexian.png" alt="">
            <div class="synchcontentTitle">
              <span></span>
              <h3>{{ datas.synTitle || '这是栏目标题' }}</h3>
            </div>
            <div class="optionlist">
              <div class="appListType0" v-show="datas.appListType === 0" v-for="index in 4" :key="index">
                <img src="../../../assets/images/mor.png" alt="">
                <p>标题名称</p>
              </div>
              <div class="appListType1" v-show="datas.appListType === 1" v-for="ind in 4" :key="ind + '00'">
                <img src="../../../assets/images/mor.png" alt="">
                <p>标题名称</p>
              </div>
            </div>
          </div>
          <!-- 有内容 -->
          <div class="synchcontent" v-show="datas.imageList && datas.imageList[0]">
            <img class="zhanwei" src="../../../assets/img/icon10-1.png" alt="" />
            <img class="fengexian" v-show="datas.appListType === 0" src="../../../assets/images/fengexian.png" alt="">
            <div class="synchcontentTitle">
              <span></span>
              <h3>{{ datas.synTitle || '这是栏目标题' }}</h3>
            </div>
            <div class="optionlist">
              <div class="appListType0" v-show="datas.appListType === 0" v-for="(item,index) in datas.imageList" :key="index">
                <img :src="item.src" alt="">
                <p>{{ item.title }}</p>
              </div>
              <div class="appListType1" v-show="datas.appListType === 1" v-for="(ite,ind) in datas.imageList" :key="ind + '00'">
                <img :src="ite.src" alt="">
                <p>{{ ite.title }}</p>
              </div>
            </div>
          </div>
        </div>
      </div>
    </div>
    <div v-else>
      <div class="newSynchronouspewicon defaultcommodityList0">
        <img src="../../../assets/img/icon10-1.png" alt="" />
      </div>
    </div>
    <!-- 删除组件 -->
    <slot name="deles" />
  </div>
</template>

<script>
export default {
  name: "NewSynchronouspew",
  props: {
    datas: Object,
  },
};
</script>

<style scoped lang="scss">
.newSynchronouspew {
  position: relative;
  .newSynchronouspewicon {
    &.defaultcommodityList0{
      width: 100%;
      height: 250px;
      display: flex;
      justify-content: center;
      align-items: center;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .defaultcommodityList1{
      padding: 10px;
      background: linear-gradient(180deg, #00D3B3 0%, #00A4D5 100%);
      .synchcontent{
        width: 350px;
        border-radius: 8px;
        background: #ffffff;
        margin-top: -10px;
        .zhanwei{
          width: 100%;
          height: 180px;
          display: block;
          margin-bottom: 20px;
        }
        .fengexian{
          width: 100%;
          height: 8px;
          display: block;
          margin-bottom: 10px;
        }
        .synchcontentTitle{
          display: flex;
          align-items: center;
          span{
            width: 4px;
            height: 18px;
            background: linear-gradient(180deg, #77F37A 0%, #53C856 100%);
            border-radius: 16px;
            display: block;
            margin-right: 12px;
          }
          h3{
            font-size: 18px;
            font-family: PingFang SC, PingFang SC;
            font-weight: 500;
            color: rgba(0,0,0,0.85);
          }
        }
        .optionlist{
          display: flex;
          align-items: center;
          flex-wrap: wrap;
          .appListType0{
            width: 25%;
            img{
              width: 48px;
              height: 48px;
              border-radius: 50%;
              display: block;
              margin: 10px auto;
            }
            p{
              font-size: 12px;
              font-family: PingFang SC-Regular, PingFang SC;
              font-weight: 400;
              color: rgba(0,0,0,0.65);
              text-align: center;
            }
          }
          .appListType1{
            width: 160px;
            height: 52px;
            background: #fff;
            box-shadow: 0px 3px 12px 0px rgba(0,0,0,0.05);
            border-radius: 10px;
            display: flex;
            align-items: center;
            margin-left: 10px;
            margin-bottom: 10px;
            img{
              width: 36px;
              height: 36px;
              border-radius: 50%;
              display: block;
              margin: 0 15px 0 30px;
            }
            p{
              font-size: 12px;
              font-family: PingFang SC-Regular, PingFang SC;
              font-weight: 400;
              color: rgba(0,0,0,0.65);
            }
          }
        }
      } 
    }
  }
}
</style>
